package com.net.oil.oilWear.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.oilWear.contract.AddOilWearContract;
import com.net.oil.oilWear.model.AddOilWearModel;

/**
 * 作者：lch
 * 时间：2019/1/20 0020:下午 22:11
 * 邮箱：245850413@qq.com
 * 说明：
 */
public class AddOilWearPresenter extends BasePresenter<AddOilWearContract.View> implements AddOilWearContract.Presenter {

    private AddOilWearContract.View view;
    private AddOilWearContract.Model model;

    public AddOilWearPresenter(AddOilWearContract.View view) {
        this.view = view;
        model = new AddOilWearModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void addFillOilRecord(int carId, int currentMileage, double quantity, double price, double oilMoney, String date) {
        model.addFillOilRecord(carId, currentMileage, quantity, price, oilMoney, date);
    }

    @Override
    public void addFillOilRecordSuccess() {
        view.addFillOilRecordSuccess();
    }

    @Override
    public void addFillOilRecordFailed() {
        view.addFillOilRecordFailed();
    }

    @Override
    public void updateFillOilRecord(int id, int currentMileage, double quantity, double price, double oilMoney) {
        model.updateFillOilRecord(id, currentMileage, quantity, price, oilMoney);
    }

    @Override
    public void updateFillOilRecordSuccess() {
        view.updateFillOilRecordSuccess();
    }

    @Override
    public void updateFillOilRecordFailed() {
        view.updateFillOilRecordFailed();
    }
}
